package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.Car;
import com.xmtlxx.tms.domain.bo.CarBo;
import com.xmtlxx.tms.domain.vo.CarVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 车辆Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface CarMapper extends BaseMapperPlus<CarMapper, Car, CarVo> {
    /**
     * 根据条件分页查询车辆
     *
     * @param car 车辆
     * @return Page Car
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
//        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    Page<CarVo> selectPageCarList(@Param("page") Page<Car> page,@Param("car") CarBo car);

    /**
     * 查询车辆列表
     *
     * @param car 车辆
     * @return 车辆集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    List<CarVo> selectCarList(@Param("car") CarBo car);

    CarVo selectCarVoByID(String id);
}
